import request from "@/utils/request";

/**
 * @desc 获取图片验证码
 *
 */
export function getCodeData() {
	return request.get("/device/prod-api/code")
}

/**
 * @desc 登录
 *
 */
export function login(params) {
	return request.post('/device/prod-api/auth/login', params, true, {
		urlJoin: true 
	});
}

/**
 * @desc 获取用户信息
 *
 */
export function getInfo() {
	return request.get("/device/prod-api/system/user/getInfo")
}

/**
 * @desc 建档-查询登录用户的所有企业
 *
 */
export function getAllFactory() {
	return request.get("/device/prod-api/oil/factory/getAllFactory")
}


/**
 * @desc 建档-建档拍摄照片
 *
 */
export function upload(params) {
	return request({
	url: '/device/prod-api/file/upload',
	method: 'post',
	data: params,
	header: {
		Authorization: 'bearer ' + uni.getStorageSync('token'),
	},
	})
}

/**
 * @desc 建档-查询密封点类型字典
 *
 */
export function pointType() {
	return request.get('/device/prod-api/system/dict/data/type/point_type')
}

/**
 * @desc 建档-查询物料状态字典
 *
 */
export function materialStatus() {
	return request.get('/device/prod-api/system/dict/data/type/material_status')
}


/**
 * @desc 建档-批量上传建档数据
 *
 */
export function batchInsertPoint(params) {
	return request.post('/device/prod-api/oil/app/batchInsertPoint', params);
}


/**
 * @desc 查询季度字典
 *
 */
export function season() {
	return request.get('/device/prod-api/system/dict/data/type/season')
}


/**
 * @desc 检测-选择年份（必填）和季度（必填）根据用ID获取检测任务列表
 *
 */
export function examProgress(params) {
	return request.get('/device/prod-api/oil/app/examProgress',params)
}


/**
 * @desc 查询仪器编号
 * @param {Object} params
 */
export function queryDeviceByFactory(params) {
	return request.get('/device/prod-api/oil/app/queryDeviceByFactory',params)
}

/**
 *  @desc 上传上传校准记录
 * @param {Object} params
 */
export function deviceCorrect(params) {
	return request.post('/device/prod-api/oil/app/deviceCorrect', params);
}


/**
 *  @desc 上传气象检测参数信息
 * @param {Object} params
 */
export function weatherRecord(params) {
	return request.post('/device/prod-api/oil/app/weatherRecordSystem', params);
}



/**
 * @desc 检测-根据任务ID下载密封点信息以及群组图片
 *
 */
export function examPointList(params) {
	return request.get('/device/prod-api/oil/app/examPointList',params);
}


/**
 * @desc 检测-批量上传检测值
 *
 */
export function batchInsertExam(params) {
return request.post('/device/prod-api/oil/app/batchInsertExam', params);
}

/**
 * @desc 检测-定位
 *
 */
export function positionStart(params) {
	return request.post('/device/prod-api/oil/app/positionStart', params);
}

/**
 * @desc 检测-刷新定位，半小时
 *
 */
export function positionAdd(params) {
	return request.post('/device/prod-api/oil/app/positionAdd', params);
}









